#ifndef VOLUMECONTENTHANDLER_HPP
#define VOLUMECONTENTHANDLER_HPP

#include <QtXml/QXmlContentHandler>
#include <QtXml/QXmlAttributes>
#include <QtCore>
#include <Eigen/Core>

using namespace Eigen;

class VolumeContentHandler : public QXmlDefaultHandler {
  public:
    VolumeContentHandler();
    ~VolumeContentHandler();
    bool startElement(const QString &namespaceURI,const QString &localName,const QString &qName,const QXmlAttributes &atts);
    bool characters(const QString &data);
    bool endElement(const QString &namespaceURI,const QString &localName,const QString &qName);
    const Vector3i & getSize() const;
    double getDelta();
    const Vector3d & getPosition() const;
    unsigned char * getVoxels();
    int getNumVoxels();
  private:
    QByteArray data;
    int numVoxels;
    Vector3i dim;
    double delta;
    Vector3d pos;
    bool inComingData;
};

#endif
